<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*"%>
<html>
<body>
<%
    String sql="insert into user values(1,'";
    String url="jdbc:mysql://localhost:3306/easytouch";
    String user="root";
    String password="huawei";
    String userName = request.getParameter("firstname");
    String passWd= request.getParameter("password");
    
    try
    {
       Class.forName("com.mysql.jdbc.Driver").newInstance();
    }
    catch(ClassNotFoundException e)
    {
       out.println("driver not found");
    }
    sql=sql+userName+"',\'"+passWd+"');";
    out.print(sql);
    
    Connection conn=DriverManager.getConnection(url,user,password);
    Statement stm=conn.createStatement();
    int  rs=stm.executeUpdate(sql);
    if(rs== 1)
    {
     
       response.sendRedirect("http://12.133.183.204:9999/plugins/fastpath/workgroup-create.jsp");
    }
    else 
    {
       response.sendRedirect("index.html");
    }
    //rs.close();
    stm.close();
    conn.close();
%>
</body>
</html> 
